package headfirst.designpatterns.observer.simpleobservable;

import java.util.Observable;

public class SimpleSubject extends Observable {
    private int value = 0;

    public SimpleSubject() {
    }

    public int getValue() {
        return this.value;
    }

    public void changeValue(int value) {
        this.value = value;
        super.setChanged();// 调用父类接口
        super.notifyObservers(value);// 调用父类接口
    }

}